home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-19
/
surfsrc3.zip
/
WIREFRAM.INC
< prev
next >
Wrap
Text File
|
1991-09-28
|
2KB
|
76 lines
procedure WIREFRAME;
{ Make a wireframe drawing of the object }
var Node: word; { node # }
Surf: word; { surface # }
User_abort: boolean; { did the user abort? }
ch: char;
label ABORTTEXT, { text-mode abort }
ABORTGRPH; { graphics-mode abort }
begin
{$ifdef BIGMEM}
with ptra^ do with ptrb^ do with ptrc^ do
with ptrd^ do with ptre^ do with ptrf^ do
with ptri^ do
begin
{$endif}
perf_start;
User_abort := TRUE;
if (Viewchanged) then begin
menumsg ('Transforming to 2-D...');
if (checkey) then goto ABORTTEXT;
{ Transform from 3-D to 2-D coordinates }
setorigin;
for Node := 1 to Nnodes do
perspect (Xworld[Node], Yworld[Node], Zworld[Node],
Xtran[Node], Ytran[Node], Ztran[Node]);
{ Set plotting limits and normalize transformed coords to screen coords }
perspect (Xfocal, Yfocal, Zfocal, Xfotran, Yfotran, Zfotran);
if (not setnormal (Xfotran, Yfotran, XYmax)) then begin
menumsg ('Warning: Focal point outside data limits.');
writeln;
write (' Press any key ...');
ch := readkey;
end;
if (checkey) then goto ABORTTEXT;
{ Normalize all the nodes }
for Node := 1 to Nnodes do
normalize (Xtran[Node], Ytran[Node], Xfotran, Yfotran, XYmax);
end; { if Viewchanged }
{$ifdef USE_IFF}
menumsg ('Plotting...');
{$endif}
{ Draw the outline of each surface }
setgmode (Nmatl);
for Surf := 1 to Nsurf do begin
border (Surf, Matl[Surf]);
if (grafstat) then goto ABORTGRPH;
end;
drawaxes (Xfotran, Yfotran, XYmax);
perf_stop (2);
{$ifdef USE_IFF}
menumsg ('Saving IFF...');
saveiff (Filemask + '.IFF', VGApal);
{$else}
{ Wait for user keypress to continue }
continue;
{$endif}
User_abort := FALSE;
ABORTGRPH:
exgraphic;
ABORTTEXT:
if (User_abort) then
perf_stop (0);
{$ifdef BIGMEM}
end; {with}
{$endif}
end; {procedure WIREFRAME }